<?php
	include 'connectDB.php';
	
?>
	<html>
		</head>
		<script src="jquery-1.7.js"></script>
		<script src="jquery-ui-1.8.16.custom.min.js"></script>
		<link rel = "stylesheet" type = "text/css" href = "styles/jquery-ui-1.8.16.custom.css">
		<link rel = "stylesheet" type = "text/css" href = "styles/mainStyle.css">
			<title></title>
		</head>
		<body>
			<div id='main'>
				<div id='buttons'>
					<a href='index.php'><div id="logo">Welcome!</div></a>
					<ul id='ulTop'>
					<?php
						if (isset($_SESSION['logged']))
						{
							echo"<li class='topButtons' id='profileButton'>Profile Settings</li>";
							echo"<a href='buyAds.php'><li class='topButtons' id='buyAds'>Buy Ads</li></a>";
							echo"<a href='sellAds.php'><li class='topButtons' id='sellAds'>Sell Ads</li></a>";
							echo"<a href='contacts.php'><li class='topButtons'>Contacts</li></a>";
						}
						else
						{
							echo"
							<a href='index.php'><li class='topButtons'>Home</li></a>
							<a href='login.php'><li class='topButtons'>Login</li></a>
							<a href='register.php'><li class='topButtons'>Register</li></a>
							<a href='contacts.php'><li class='topButtons'>Contacts</li></a>";
						}
					?>
					</ul>
				</div>
				<div id="wrapper">
				<div id='secondBar'>
				<div id='searchBox'>
						<input type='text'id='searchField'>
						<button id='searchButton'>Search</button>
					</div>
				<div id='navButs'>
					<ul>
						<a href='index.php'><li id='getStarted' class='someButtons'>Get Started</li></a>
						<li id='overview' class='someButtons'>Overview</li>
						<li id='tutorial' class='someButtons'>How does it work?</li>
					</ul>
				</div>
				</div>
					<div id='content'>
						lalalalalalalf

					</div>
					<div id="clear">
					</div>
				</div>
				<div id="profile">
					<div id='profileContent'>
					</div>
				<div id='leftButtons'>
				<ul>
					<li class='leftButtons' id='accBalance'>Account balance</li>
					<li class='leftButtons' id='myAds'>My ads</li>
					<li class='leftButtons' id='publishers'>Publishers</li>
					<li class='leftButtons' id='accountSettings'>Account Settings</li>
					<li class='leftButtons' id='cashoutSettings'>Cashout Settings</li>
					<li class='leftButtons' id='billingAndDeposit'>Billing &amp; Deposit</li>
				<ul>
				</div>
				</div>
				<div id="clear">
				</div>
			</div>
			</div>
		</body>
		<script>
		var clickedBut="";
		var profileState=0;
		$("#profileButton").click(function() {
		if(profileState==0)
			{
				$("#wrapper").css("display", "none");
				$("#profile").css("display", "block");
				profileState=1;
				$('#profileContent').load('accountBalance.php');
			}	
		else
			{
				$("#wrapper").css("display", "block");
				$("#profile").css("display", "none");
				profileState=0;
			}
		});
		//tuka ima malko(mn e ama me e sram da si kaja ) bug pregledai go ako iska6 6toto az iztre6tqh ve4e :d
	/*	function unclicked(clickedButton)
		{
			clickedButton="$('#"+clickedButton+"')";
			alert(clickedButton);
			clickedButton.css('border-top-left-radius', '0px');
			clickedButton.css('border-top-right-radius', '0px');
			clickedButton.css('border-bottom-left-radius', '0px');
			clickedButton.css('border-bottom-right-radius', '0px');
			clickedButton.css('border-style', 'none');
			clickedButton.css('border-color', 'white');
			clickedButton.css('border-widht', '0px');
			clickedButton.css('boxShadow','0px 0px 0px white');
		};
		function clicked(clickedButton)
		{
			clickedButton="$('#"+clickedButton+"')";
			alert(clickedButton);
			clickedButton.css('border-top-left-radius', '3px');
			clickedButton.css('border-top-right-radius', '3px');
			clickedButton.css('border-bottom-left-radius', '8px');
			clickedButton.css('border-bottom-right-radius', '3px');
			clickedButton.css('border-style', 'solid');
			clickedButton.css('border-color', '#b8b8b8');
			clickedButton.css('border-widht', '1px');
			clickedButton.css('boxShadow','2px 2px 8px #b8b8b8');
		};
		$('.leftButtons').click(function(){
			$('.leftButtons').removeClass('flash');
			$(this).addClass('flash');
			var id = $('.flash').attr('id');
			if(clickedBut=="")
			{
				clickedBut=id;
				//alert(clickedBut);
				clicked(clickedBut);
			}
			else
			{
				unclicked(clickedBut);
				clickedBut=id;
				clicked(clickedBut);
			}
		});*/
		$('#accBalance').click(function(){
			$('#profileContent').load('accountBalance.php');
		});
		$('#myAds').click(function(){
			$('#profileContent').load('myAds.php');
		});
		$('#publishers').click(function(){
			$('#profileContent').load('publishers.php');
		});
		$('#accountSettings').click(function(){
			$('#profileContent').load('accountSettings.php');
		});
		$('#cashoutSettings').click(function(){
			$('#profileContent').load('cashoutSettings.php');
		});
		$('#billingAndDeposit').click(function(){
			$('#profileContent').load('accountBalance.php');
		});
		</script>
	</html>